package com.foreknow.demo6;

/**
 * @author shkstart
 * @create 2021-07-27 13:30
 */
public class Student extends Person {
    private String sid;  //学生id
    private String spwd;  //学生密码
    private String sname; //学生姓名

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public String getSpwd() {
        return spwd;
    }

    public void setSpwd(String spwd) {
        this.spwd = spwd;
    }

    public Student() {
    }

    public Student(String sid, String sname) {
        this.sid = sid;
        this.sname = sname;
    }

    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    @Override
    public boolean register(String sid,String spwd) {
        return false;
    }

    @Override
    public boolean login(Person person) {
        if(person instanceof Student){
            Student s1=(Student)person;
            if(s1.getSid().equals("admin")&&s1.getSpwd().equals("123456")){
                return true;
            }else {
                return false;
            }
        }
        return false;
    }


    @Override
    public Person search(String id) {
        return null;
    }

    @Override
    public Person[] searchAll() {
        return new Person[0];
    }

    @Override
    public int deleteById(String id) {
        return 0;
    }



}
